package org.jproxy;

import javax.servlet.http.HttpServletRequest;

public class ResourcePool
{
	private ThreadLocal<HttpServletRequest> requestLocal;

	private static final ResourcePool pool = new ResourcePool();

	private ResourcePool()
	{
		requestLocal = new ThreadLocal<HttpServletRequest>();
	}

	public static ResourcePool getInstance()
	{
		return pool;
	}

	public HttpServletRequest getHttpServletRequest()
	{
		return requestLocal.get();
	}

	void putHttpServletRequest(HttpServletRequest request)
	{
		requestLocal.set(request);
	}

	void removeHttpServletRequest()
	{
		requestLocal.remove();
	}

}
